package ccm.component.override;

import ccm.common.CCMConfigManager;

import javax.swing.border.Border;
import java.awt.*;

import static ccm.common.Utils.fontResize;

public class TitledBorder extends javax.swing.border.TitledBorder
{
    static
    {
        CCMConfigManager.setFont("ccm/general/titleFont",fontResize(CCMConfigManager.getFont("ccm/general/font"),0.8f));
    }

    public TitledBorder(String title)
    {
        super(title);
        setTitleFont(CCMConfigManager.getFont("ccm/general/titleFont"));
    }

    public TitledBorder(Border border)
    {
        super(border);
        setTitleFont(CCMConfigManager.getFont("ccm/general/titleFont"));
    }

    public TitledBorder(Border border,String title)
    {
        super(border,title);
        setTitleFont(CCMConfigManager.getFont("ccm/general/titleFont"));
    }

    public TitledBorder(Border border,String title,int titleJustification,int titlePosition)
    {
        super(border,title,titleJustification,titlePosition);
        setTitleFont(CCMConfigManager.getFont("ccm/general/titleFont"));
    }

    public TitledBorder(Border border,String title,int titleJustification,int titlePosition,Font titleFont)
    {
        super(border,title,titleJustification,titlePosition,titleFont);
        setTitleFont(CCMConfigManager.getFont("ccm/general/titleFont"));
    }

    public TitledBorder(Border border,String title,int titleJustification,int titlePosition,Font titleFont,Color titleColor)
    {
        super(border,title,titleJustification,titlePosition,titleFont,titleColor);
        setTitleFont(CCMConfigManager.getFont("ccm/general/titleFont"));
    }
}
